#include "ChannelManager.h"
#include <assert.h>
#include "talk/base/bind.h"

using namespace  talk_base;

ChannelManager::ChannelManager()
	:worker_thread_(NULL)
{
	worker_thread_ = new talk_base::Thread();
	assert(worker_thread_ != NULL);
	worker_thread_->Start();
}

ChannelManager::~ChannelManager()
{
	worker_thread_->Stop();
}

bool ChannelManager::SetString(std::string message)
{
	return worker_thread_->Invoke<bool>(Bind(&ChannelManager::SetString_w, this,message));
}


bool ChannelManager::SetString_w(std::string message)
{
	printf("message %s\n", message.c_str());

	return true;
}